package com.adam.springbucks.beas;

import com.adam.springbucks.entity.Phone;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * bean自动装配方式2：实现FactorBean接口
 */
@Component
public class MyPhoneFactorBean implements FactoryBean<Phone> {
    @Override
    public Phone getObject() throws Exception {
        return new Phone();
    }

    @Override
    public Class<?> getObjectType() {
        return Phone.class;
    }
}
